{% load static %}
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="https://api.ghser.com/qinghua?type=js"></script>
    <script type="text/javascript" src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="{% static 'jquery/jquery-3.6.0.min.js' %}"></script>
    <script>
     function showImg(){
        // var img_file =  $("#img_file").val();
        var file =  document.getElementById('img_file').files[0];
        var re = new FileReader();
        re.readAsDataURL(file);
        re.onload = function(re){
            $('#img_id').attr("src", re.target.result);
        }
     }
    </script>
    <style>

    </style>
</head>
<body>
   <div class="layui-form-item">
        <label class="layui-form-label">图片地址</label>
        <div class="layui-input-block">
            <input type="hidden" id="img_url">
            <input type="file" onchange="showImg()" id="img_file">
            <img src="" alt="" id="img_id" style="width: 100px">
        </div>
  </div>
</body>
</html>

<script>
        /*
        for(i=1;i<{{page.intro_num}}+1;i++){
        addTextInput("intro");
        document.getElementByName("intro_"+i)[0].value="{{intros[i-1]['description']}}";
        }
        */
        for(var v in {{intros}}){
        console.info(v);
        }
        /*
        for(i=1;i<{{page.paper_num}}+1;i++){
        addTextInput("paper");
        document.getElementByName("paper_"+i)[0].value="{{papers[i-1].description}}";
        document.getElementByName("paper_time_"+i)[0].value="{{papers[i-1].time}}";
        document.getElementByName("paper_title_"+i)[0].value="{{papers[i-1].title}}";
        document.getElementByName("paper_link_"+i)[0].value="{{papers[i-1].link}}";
        document.getElementByName("paper_people_"+i)[0].value="{{papers[i-1].auther_list}}";
        }
        for(i=1;i<{{page.project_num}}+1;i++){
        addTextInput("project");
        document.getElementByName("project_"+i)[0].value="{{projects[i-1].description}}";
        document.getElementByName("project_time_"+i)[0].value="{{projects[i-1].time}}";
        document.getElementByName("project_title_"+i)[0].value="{{projects[i-1].title}}";
        document.getElementByName("project_link_"+i)[0].value="{{projects[i-1].link}}";
        document.getElementByName("project_people_"+i)[0].value="{{projects[i-1].auther_list}}";
        }
        for(i=1;i<{{page.record_num}}+1;i++){
        addTextInput("record");
        document.getElementByName("record_"+i)[0].value="{{records[i-1].description}}";
        document.getElementByName("record_time_"+i)[0].value="{{records[i-1].time}}";
        document.getElementByName("record_title_"+i)[0].value="{{records[i-1].title}}";

        }
        for(i=1;i<{{page.service_num}}+1;i++){
        addTextInput("service");
        document.getElementByName("service_"+i)[0].value="{{services[i-1].description}}";
        document.getElementByName("service_time_"+i)[0].value="{{services[i-1].time}}";
        document.getElementByName("service_title_"+i)[0].value="{{services[i-1].title}}";
        document.getElementByName("service_link_"+i)[0].value="{{services[i-1].link}}";
        }
        for(i=1;i<{{page.award_num}}+1;i++){
        addTextInput("award");
        document.getElementByName("award_"+i)[0].value="{{awards[i-1].description}}";
        document.getElementByName("award_time_"+i)[0].value="{{awards[i-1].time}}";
        document.getElementByName("award_title_"+i)[0].value="{{awards[i-1].title}}";
        document.getElementByName("award_link_"+i)[0].value="{{awards[i-1].link}}";
        document.getElementByName("award_people_"+i)[0].value="{{awards[i-1].auther_list}}";
        }
        */
    </script>




